<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>flex-wrap</title>
  <style>
    /* 父元素 */
    .container {
      width: 300px;
      height: 300px;
      margin: 0 auto;
      background-color: lemonchiffon;
      /* 容器属性-设置给父元素 */
      /* 开启弹性盒布局 
      弹性元素沿着主轴方向排列
      */
      display: flex;
      /* 默认不换行 如果弹性元素超出父容器宽度-子元素等比例压缩 */
      /* 1.设置弹性元素换行:wrap 不换行：nowrap */
      /* flex-wrap: wrap; */
      /* 2.反向换行 */
      flex-wrap: wrap-reverse;

      /* 3.flex-flow:flex-direction和flex-wrap的集合 */
      /* flex-flow: row nowrap; */
      /*  */




    }

    /* 子元素 */
    .container div {
      width: 60px;
      height: 50px;
      color: white;
    }
  </style>
</head>

<body>
  <div class="container">
    <div class="div1" style="background-color:red;">弹性元素1</div>
    <div class="div2" style="background-color:blue;">弹性元素2</div>
    <div class="div3" style="background-color:green;">弹性元素3</div>
    <div class="div1" style="background-color:red;">弹性元素1</div>
    <div class="div2" style="background-color:blue;">弹性元素2</div>
    <div class="div3" style="background-color:green;">弹性元素3</div>

  </div>

</body>

</html>